package APE.Flux;

import java.io.InputStream;
import java.io.ObjectInput;
import java.io.ObjectInputStream;
import java.net.ServerSocket;
import java.net.Socket;
import java.util.Date;

public class ExecType {


 
	
	public static void main(String[] args) {
		EnvoiType et = new EnvoiType();
		ServerSocket serveur = null;
	    Socket soc = null;
	    int str;
	    Date d = null;
	    try {
	      serveur = new ServerSocket(8020);
	      soc = serveur.accept();
	      System.out.println("en attente ...");
	      InputStream o = soc.getInputStream();
	      ObjectInput s = new ObjectInputStream(o);
	      System.out.println("Flux pris!");
	      str =  (int) s.readObject();
	      d = (Date) s.readObject();
	      s.close();
	      
	      System.out.println(str);
	      System.out.println(d);
	    } catch (Exception e) {
	        System.out.println(e.getMessage());
	        System.out.println("Erreur de serialization");
	        System.exit(1);
	    }	
		

			

	}

}
